<?php
class Conexion{

private $Servidor = 'localhost';
private $Usuario ='root';
private $Clave='letty';
private $Basedato='magsi_db';



private function Conectar(){
$con = mysqli_connect($this->Servidor,$this->Usuario,$this->Clave,$this->Basedato) or die('error');
return $con;
}

public function insertarmate($ER){

$ER = implode("|",$_POST["er"]);
 $sql = "INSERT INTO ma_af_suplem (MA_V_TipoSuplem)
 	 VALUES ('$ER')";

     $con =$this->Conectar();
      mysqli_query($con,$sql) or die('no insertado'.mysqli_error($con));

      if($con){

header('location:index.php');


      }
}

public function insertarCantidad($CAHE){

 $sql = "INSERT INTO ma_af_detsuplem (MA_In_CantSuplem)
 	 VALUES (' $CAHE')";
     $con =$this->Conectar();
      mysqli_query($con,$sql) or die('no insertado'.mysqli_error($con));

      if($con){

header('location:index.php');


}

      }


}
	





?>